function pairedMapAnalyses(handles)
% pairMapAnalyses
%
% Editing:
% gs june 2005
% ---------------------------------------------------------

% data -- map stacks
mapsA = handles.analysis.mapAverager.groupA.mapStack;
mapsB = handles.analysis.mapAverager.groupB.mapStack;

% check that map stacks are equal in size
[a1, a2, a3] = size(mapsA);
[b1, b2, b3] = size(mapsB);
if a1 ~= b1 | a2 ~= b2 | a3 ~= b3
    disp('Map stacks must be equal in size');
    return
end

% % straighten out the maps into vectors
% vecsA = [];
% vecsB = [];
% for N = 1 : a3
%     
%     A = mapsA(:, :, N);
%     vecsA(:, N) = reshape(A, a1 * a2, []);
%     B = mapsB(:, :, N);
%     vecsB(:, N) = reshape(B, b1 * b2, []);
%     
%     % delete any NaNs and infs
% end



% 
A = -handles.analysis.mapAverager.groupA.allROI.vecY';
B = -handles.analysis.mapAverager.groupB.allROI.vecY';
assignin('base', 'groupAvec', A);
assignin('base', 'groupBvec', B);
figure;
plot(A, B, 'bo');
X = A\B;